Conversation
Codecov Report
@@ Coverage Diff @@
## master #4954 +/- ##
==========================================
+ Coverage 77.24% 77.33% +0.08%
==========================================
Files 133 133
Lines 22134 22166 +32
==========================================
+ Hits 17097 17141 +44
+ Misses 5037 5025 -12
Continue to review full report at Codecov.
|
sgugger
left a comment
There was a problem hiding this comment.
Thanks for your PR! I think there is a way to make it more consistent with the other models for multiple choice and avoid introducing a new class, would you mind looking into it?
src/transformers/modeling_electra.py
Outdated
| return outputs # (loss), start_logits, end_logits, (hidden_states), (attentions) | ||
|
|
||
|
|
||
| class ElectraPooler(nn.Module): |
There was a problem hiding this comment.
Instead of introducing a new class, I'd rather use the existing SequenceSummary which can do the pool + dropout (see the XLNetForMultipleChoice for an example. It will require to add a few things to the config to make it work (see XLNetConfig for an example).
There was a problem hiding this comment.
I think there is a way to make it more consistent with the other models for multiple choice and avoid introducing a new class, would you mind looking into it?
Sure, I wasn't aware of SequenceSummary. I'll try to use it instead of Pooler
There was a problem hiding this comment.
But couldn't you just use the ElectraClassificationHead for that pooling 🤔:
transformers/src/transformers/modeling_electra.py
Lines 346 to 362 in 86578bb
There was a problem hiding this comment.
Sadly no, because it adds a linear layer to num_labels
LysandreJik
left a comment
There was a problem hiding this comment.
LGTM, thanks @patil-suraj
|
hi @LysandreJik could you tell me why these tests are failing now ? Thanks. |
|
Looks like @LysandreJik deleted a function by mistake during the merge (the |
|
My bad, sorry about that. Thanks for the fix! |
This PR add
ElectraForMultipleChoice. One of the missing models in this project.Since, for multiple choice pooled outputs are needed, added
ElectraPoolerclass.@sgugger , @LysandreJik